package com.quick.service.impl;

import com.quick.domain.User;
import com.quick.repository.UserRepository;
import com.quick.service.BookService;
import com.quick.service.UserService;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import javax.annotation.Resource;

/**
 * Created by jing on 2017/12/5.
 */
@Service
public class UserServiceImpl implements UserService{
    @Resource
    private UserRepository userRepository;

    @Resource
    private BookService bookService;

    @Transactional
    @Override
    public void save() {
        User user = new User();
        user.setName("wang");
        user.setHobby("pingpang");
        userRepository.save(user);
        bookService.save();
    }
}
